 package cn.exrick.xboot.modules.content.dao;

 import cn.exrick.xboot.base.XbootBaseDao;
 import cn.exrick.xboot.modules.content.entity.HontLog;
 import org.springframework.data.jpa.repository.Modifying;
 import org.springframework.data.jpa.repository.Query;

 import javax.persistence.Transient;
 import java.util.List;
 import java.util.Map;


 /**
  * 测试数据处理层
  * @author Exrick
  */
 public interface HontLogDao extends XbootBaseDao<HontLog, String> {
  /**
   * 统计当前时间段每天的登录人数
   * @param beginDate
   * @param endDate
   * @return
   */
  @Transient
  @Query(value = "select DATE_FORMAT(create_time,'%Y-%m-%d') as createTime ,count(*) as count from hont_log where create_time>:beginDate and create_time<:endDate  group by createTime ORDER BY createTime ",nativeQuery = true)
  List<Map<String, Object>> getHontLog(String beginDate, String endDate);
 }